#!/usr/bin/ruby
class_path = "antlr-3.0.1.jar:antlr-2.7.7.jar:stringtemplate.jar:gnujaxp.jar:jcommon-1.0.12.jar:servlet.jar:jfreechart-1.0.8a-experimental.jar:jfreechart-1.0.8a.jar:junit.jar:jfreechart-1.0.8a-swt.jar:itext-2.0.6.jar:."
puts "***** Building the Lexer, Parser, and Walker *****"
puts `java -cp #{class_path} org.antlr.Tool Graphr.g GraphrWalker.g`
puts "***** Building TestGraphr *****"
puts `javac -cp #{class_path} TestGraphr.java`
puts "***** Building Graphr *****"
puts `javac -cp #{class_path} Graphr.java`
puts "***** Packaging everything into a single jar file *****"
puts `jar cvfm Graphr.jar Manifest.txt *.class antlr-3.0.1.jar antlr-2.7.7.jar stringtemplate.jar`

load 'all_tests.rb' unless ARGV[0] == "none"